package com.imu.purse.modules.trade.dao;

import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.imu.core.base.BaseMapper;
import com.imu.purse.modules.trade.entity.GradeInfoEntity;

/**
 * IMU转账日志表
 * @author sunhongwei
 * @email sunhongwei@jshijian.com
 * @date 2018-07-01 16:21:08
 * Copyright (c) 2017 武汉极时间科技有限公司 版权所有 
 * Jshijian aloha CO.,LTD. All Rights Reserved. 
 */
public interface GradeInfoMapper extends BaseMapper<GradeInfoEntity>
{
	/**
     * 分页查询
     * @param pageNo 页号
     * @param pageSize 每页显示记录数
     * @return
     */
	@Select({
		"<script>",
		    "SELECT id,",
					"user_id, ",
					"hbc, ",
					"imu, ",
					"CURR_GRADE, ",
					"NOW_GRADE, ",
					"type, ",
					"create_time, ",
					"update_time",
		    "FROM imu_grade_info ",
		    "WHERE 1 = 1 ",
			"<when test = 'userId != null'>",
		    	"AND `user_id` = #{userId}",
		    "</when>",
		    "ORDER BY time_create DESC",
    	"</script>"
	})
    public List<GradeInfoEntity> findByPage(final GradeInfoEntity entity);	
}
